import React, { Component } from "react";
import HomeHotUI from "./HomeHotUI/HomeHotUI.jsx";
import api from "../../../api/index.js";
let { homehot1Data, homehot2Data } = api.homehot;

// console.log(homehot1Data);

class HomeHot extends Component {
  constructor(props) {
    super(props);
    this.state = {
      homehot1: [],
      homehot2: [],
    };
  }

  componentDidMount() {
    console.log(homehot1Data);
    homehot1Data().then((result) => {
      console.log(result);
      this.setState({
        homehot1: result,
      });
    });
    homehot2Data().then((result) => {
      console.log(result);
      this.setState({
        homehot2: result,
      });
    });
  }
  render() {
    let { homehot1, homehot2 } = this.state;
    return (
      <div>
        <HomeHotUI data={homehot1} title="男人抢手商品" />
        <HomeHotUI data={homehot2} title="女人抢手商品" />
      </div>
    );
  }
}

export default HomeHot;
